{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Text Rank with NLTK"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from bs4 import BeautifulSoup\n",
    "from urllib.request import urlopen\n",
    "from nltk.tokenize import sent_tokenize\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "from nltk.corpus import stopwords\n",
    "from sklearn.metrics.pairwise import cosine_similarity\n",
    "import networkx as nx"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=====================\n",
      "\n",
      "\t\t\t\tRemarks\t\t\t \n",
      "Issued on:\n",
      "February 6, 2019\n",
      " February 5, 2019\n",
      "9:07 P.M. EST THE PRESIDENT:  Madam Speaker, Mr. Vice President, Members of Congress, the First Lady of the United States — (applause) — and my fellow Americans: We meet tonight at a moment of unlimited potential.  As we begin a new Congress, I stand here ready to work with you to achieve historic breakthroughs for all Americans. Millions of our fellow citizens are watching us now, gathered in this great chamber, hoping that we will govern not as two parties but as one nation.  (Applause.) The agenda I will lay out this evening is not a Republican agenda or a Democrat agenda.  It’s the agenda of the American people. Many of us have campaigned on the same core promises: to defend American jobs and demand fair trade for American workers; to rebuild and revitalize our nation’s infrastructure; to reduce the price of healthcare and prescription drugs; to create an immigration system that is safe, lawful, modern, and secure; and to pursue a foreign policy that puts America’s interests first. There is a new opportunity in American politics, if only we have the courage, together, to seize it.  (Applause.)  Victory is not winning for our party.  Victory is winning for our country.  (Applause.) This year, America will recognize two important anniversaries that show us the majesty of America’s mission and the power of American pride. In June, we mark 75 years since the start of what General Dwight D. Eisenhower called the “Great Crusade” — the Allied liberation of Europe in World War II.  (Applause.)  On D-Day, June 6th, 1944, 15,000 young American men jumped from the sky, and 60,000 more stormed in from the sea, to save our civilization from tyranny.  Here with us tonight are three of those incredible heroes: Private First Class Joseph Reilly, Staff Sergeant Irving Locker, and Sergeant Herman Zeitchik.  (Applause.)  Please.  Gentlemen, we salute you. In 2019, we also celebrate 50 years since brave young pilots flew a quarter of a million miles through space to plant the American flag on the face of the moon.  Half a century later, we are joined by one of the Apollo 11 astronauts who planted that flag: Buzz Aldrin.  (Applause.)  Thank you, Buzz.  This year, American astronauts will go back to space on American rockets.  (Applause.) In the 20th century, America saved freedom, transformed science, redefined the middle class, and, when you get down to it, there’s nothing anywhere in the world that can compete with America.  (Applause.)  Now we must step boldly and bravely into the next chapter of this great American adventure, and we must create a new standard of living for the 21st century.  An amazing quality of life for all of our citizens is within reach. We can make our communities safer, our families stronger, our culture richer, our faith deeper, and our middle class bigger and more prosperous than ever before.  (Applause.) But we must reject the politics of revenge, resistance, and retribution, and embrace the boundless potential of cooperation, compromise, and the common good.  (Applause.) Together, we can break decades of political stalemate.  We can bridge old divisions, heal old wounds, build new coalitions, forge new solutions, and unlock the extraordinary promise of America’s future.  The decision is ours to make. We must choose between greatness or gridlock, results or resistance, vision or vengeance, incredible progress or pointless destruction. Tonight, I ask you to choose greatness.  (Applause.) Over the last two years, my administration has moved with urgency and historic speed to confront problems neglected by leaders of both parties over many decades. In just over two years since the election, we have launched an unprecedented economic boom — a boom that has rarely been seen before.  There’s been nothing like it.  We have created 5.3 million new jobs and, importantly, added 600,000 new manufacturing jobs — something which almost everyone said was impossible to do.  But the fact is, we are just getting started.  (Applause.) Wages are rising at the fastest pace in decades and growing for blue-collar workers, who I promised to fight for.  They’re growing faster than anyone else thought possible.  Nearly 5 million Americans have been lifted off food stamps.  (Applause.)  The U.S. economy is growing almost twice as fast today as when I took office.  And we are considered, far and away, the hottest economy anywhere in the world.  Not even close.  (Applause.) Unemployment has reached the lowest rate in over half a century.  (Applause.)  African American, Hispanic American, and Asian American unemployment have all reached their lowest levels ever recorded.  (Applause.)  Unemployment for Americans with disabilities has also reached an all-time low.  (Applause.)  More people are working now than at any time in the history of our country — 157 million people at work.  (Applause.) We passed a massive tax cut for working families and doubled the child tax credit.  (Applause.) We virtually ended the estate tax — or death tax, as it is often called — on small businesses for ranchers and also for family farms.  (Applause.) We eliminated the very unpopular Obamacare individual mandate penalty.  (Applause.)  And to give critically ill patients access to lifesaving cures, we passed, very importantly, Right to Try.  (Applause.) My administration has cut more regulations in a short period of time than any other administration during its entire tenure.  (Applause.)  Companies are coming back to our country in large numbers thanks to our historic reductions in taxes and regulations.  (Applause.) And we have unleashed a revolution in American energy.  The United States is now the number-one producer of oil and natural gas anywhere in the world.  (Applause.)  And now, for the first time in 65 years, we are a net exporter of energy.  (Applause.) After 24 months of rapid progress, our economy is the envy of the world, our military is the most powerful on Earth, by far, and America — (applause) — America is again winning each and every day.  (Applause.) Members of Congress: The state of our union is strong.  (Applause.) AUDIENCE:  USA!  USA!  USA! THE PRESIDENT:  That sounds so good.  (Laughter.) Our country is vibrant and our economy is thriving like never before. On Friday, it was announced that we added another 304,000 jobs last month alone — almost double the number expected.  (Applause.)  An economic miracle is taking place in the United States, and the only thing that can stop it are foolish wars, politics, or ridiculous partisan investigations.  (Applause.) If there is going to be peace and legislation, there cannot be war and investigation.  It just doesn’t work that way. We must be united at home to defeat our adversaries abroad.  This new era of cooperation can start with finally confirming the more than 300 highly qualified nominees who are still stuck in the Senate.  In some cases, years and years waiting.  Not right.  (Applause.)  The Senate has failed to act on these nominations, which is unfair to the nominees and very unfair to our country. Now is the time for bipartisan action.  Believe it or not, we have already proven that that’s possible. In the last Congress, both parties came together to pass unprecedented legislation to confront the opioid crisis, a sweeping new farm bill, historic VA reforms.  And after four decades of rejection, we passed VA Accountability so that we can finally terminate those who mistreat our wonderful veterans.  (Applause.) And just weeks ago, both parties united for groundbreaking criminal justice reform.  They said it couldn’t be done.  (Applause.) Last year, I heard, through friends, the story of Alice Johnson.  I was deeply moved.  In 1997, Alice was sentenced to life in prison as a first-time non-violent drug offender.  Over the next 22 years, she became a prison minister, inspiring others to choose a better path.  She had a big impact on that prison population, and far beyond. Alice’s story underscores the disparities and unfairness that can exist in criminal sentencing, and the need to remedy this total injustice.  She served almost that 22 years and had expected to be in prison for the remainder of her life. In June, I commuted Alice’s sentence.  When I saw Alice’s beautiful family greet her at the prison gates, hugging and kissing and crying and laughing, I knew I did something right.  Alice is with us tonight, and she is a terrific woman.  Terrific.  Alice, please.  (Applause.) Alice, thank you for reminding us that we always have the power to shape our own destiny.  Thank you very much, Alice.  Thank you very much.  (Applause.) Inspired by stories like Alice’s, my administration worked closely with members of both parties to sign the FIRST STEP Act into law.  Big deal.  (Applause.)  It’s a big deal. This legislation reformed sentencing laws that have wrongly and disproportionately harmed the African American community.  The FIRST STEP Act gives non-violent offenders the chance to reenter society as productive, law-abiding citizens.  Now states across the country are following our lead.  America is a nation that believes in redemption. We are also joined tonight by Matthew Charles from Tennessee.  In 1996, at the age of 30, Matthew was sentenced to 35 years for selling drugs and related offenses.  Over the next two decades, he completed more than 30 Bible studies, became a law clerk, and mentored many of his fellow inmates. Now, Matthew is the very first person to be released from prison under the FIRST STEP Act.  (Applause.)  Matthew, please.  Thank you, Matthew.  Welcome home.  (Applause.) Now, Republicans and Democrats must join forces again to confront an urgent national crisis.  Congress has 10 days left to pass a bill that will fund our government, protect our homeland, and secure our very dangerous southern border. Now is the time for Congress to show the world that America is committed to ending illegal immigration and putting the ruthless coyotes, cartels, drug dealers, and human traffickers out of business.  (Applause.) As we speak, large, organized caravans are on the march to the United States.  We have just heard that Mexican cities, in order to remove the illegal immigrants from their communities, are getting trucks and buses to bring them up to our country in areas where there is little border protection.  I have ordered another 3,750 troops to our southern border to prepare for this tremendous onslaught. This is a moral issue.  The lawless state of our southern border is a threat to the safety, security, and financial wellbeing of all America.  We have a moral duty to create an immigration system that protects the lives and jobs of our citizens.  This includes our obligation to the millions of immigrants living here today who followed the rules and respected our laws.  Legal immigrants enrich our nation and strengthen our society in countless ways.  (Applause.) I want people to come into our country in the largest numbers ever, but they have to come in legally.  (Applause.) Tonight, I am asking you to defend our very dangerous southern border out of love and devotion to our fellow citizens and to our country. No issue better illustrates the divide between America’s working class and America’s political class than illegal immigration.  Wealthy politicians and donors push for open borders while living their lives behind walls, and gates, and guards.  (Applause.) Meanwhile, working-class Americans are left to pay the price for mass illegal migration: reduced jobs, lower wages, overburdened schools, hospitals that are so crowded you can’t get in, increased crime, and a depleted social safety net.  Tolerance for illegal immigration is not compassionate; it is actually very cruel.  (Applause.) One in three women is sexually assaulted on the long journey north.  Smugglers use migrant children as human pawns to exploit our laws and gain access to our country.  Human traffickers and sex traffickers take advantage of the wide-open areas between our ports of entry to smuggle thousands of young girls and women into the United States and to sell them into prostitution and modern-day slavery. Tens of thousands of innocent Americans are killed by lethal drugs that cross our border and flood into our cities, including meth, heroin, cocaine, and fentanyl. The savage gang, MS-13, now operates in at least 20 different American states, and they almost all come through our southern border.  Just yesterday, an MS-13 gang member was taken into custody for a fatal shooting on a subway platform in New York City.  We are removing these gang members by the thousands.  But until we secure our border, they’re going to keep streaming right back in. Year after year, countless Americans are murdered by criminal illegal aliens.  I’ve gotten to know many wonderful Angel moms and dads, and families.  No one should ever have to suffer the horrible heartache that they have had to endure. Here tonight is Debra Bissell.  Just three weeks ago, Debra’s parents, Gerald and Sharon, were burglarized and shot to death in their Reno, Nevada home by an illegal alien.  They were in their eighties, and are survived by 4 children, 11 grandchildren, and 20 great-grandchildren.  Also here tonight are Gerald and Sharon’s granddaughter Heather, and great-granddaughter Madison. To Debra, Heather, Madison, please stand.  Few can understand your pain.  Thank you.  And thank you for being here.  Thank you very much.  (Applause.) I will never forget, and I will fight for the memory of Gerald and Sharon that it should never happen again.  Not one more American life should be lost because our nation failed to control its very dangerous border. In the last two years, our brave ICE officers made 266,000 arrests of criminal aliens, including those charged or convicted of nearly 100,000 assaults, 30,000 sex crimes, and 4,000 killings or murders. We are joined tonight by one of those law enforcement heroes: ICE Special Agent Elvin Hernandez.  When Elvin — (applause) — thank you. When Elvin was a boy, he and his family legally immigrated to the United States from the Dominican Republic.  At the age of eight, Elvin told his dad he wanted to become a Special Agent.  Today, he leads investigations into the scourge of international sex trafficking. Elvin says that, “If I can make sure these young girls get their justice, I’ve [really] done my job.”  Thanks to his work, and that of his incredible colleagues, more than 300 women and girls have been rescued from the horror of this terrible situation, and more than 1,500 sadistic traffickers have been put behind bars.  (Applause.)  Thank you, Elvin. We will always support the brave men and women of law enforcement, and I pledge to you tonight that I will never abolish our heroes from ICE.  Thank you.  (Applause.) My administration has sent to Congress a commonsense proposal to end the crisis on the southern border.  It includes humanitarian assistance, more law enforcement, drug detection at our ports, closing loopholes that enable child smuggling, and plans for a new physical barrier, or wall, to secure the vast areas between our ports of entry. In the past, most of the people in this room voted for a wall, but the proper wall never got built.  I will get it built.  (Applause.) This is a smart, strategic, see-through steel barrier — not just a simple concrete wall.  It will be deployed in the areas identified by the border agents as having the greatest need.  And these agents will tell you: Where walls go up, illegal crossings go way, way down.  (Applause.) San Diego used to have the most illegal border crossings in our country.  In response, a strong security wall was put in place.  This powerful barrier almost completely ended illegal crossings. The border city of El Paso, Texas used to have extremely high rates of violent crime — one of the highest in the entire country, and considered one of our nation’s most dangerous cities.  Now, immediately upon its building, with a powerful barrier in place, El Paso is one of the safest cities in our country.  Simply put: Walls work, and walls save lives.  (Applause.) So let’s work together, compromise, and reach a deal that will truly make America safe. As we work to defend our people’s safety, we must also ensure our economic resurgence continues at a rapid pace.  No one has benefitted more from our thriving economy than women, who have filled 58 percent of the newly created jobs last year.  (Applause.) You weren’t supposed to do that.  Thank you very much.  Thank you very much. All Americans can be proud that we have more women in the workforce than ever before.  (Applause.) Don’t sit yet.  You’re going to like this.  (Laughter.) And exactly one century after Congress passed the constitutional amendment giving women the right to vote, we also have more women serving in Congress than at any time before.  (Applause.) AUDIENCE:  USA!  USA!  USA! THE PRESIDENT:  That’s great.  Really great.  And congratulations.  That’s great. As part of our commitment to improving opportunity for women everywhere, this Thursday we are launching the first-ever government-wide initiative focused on economic empowerment for women in developing countries. To build on — (applause) — thank you.  To build on our incredible economic success, one priority is paramount: reversing decades of calamitous trade policies.  So bad. We are now making it clear to China that, after years of targeting our industries and stealing our intellectual property, the theft of American jobs and wealth has come to an end.  (Applause.)  Therefore, we recently imposed tariffs on $250 billion of Chinese goods, and now our Treasury is receiving billions and billions of dollars. But I don’t blame China for taking advantage of us; I blame our leaders and representatives for allowing this travesty to happen.  I have great respect for President Xi, and we are now working on a new trade deal with China.  But it must include real, structural change to end unfair trade practices, reduce our chronic trade deficit, and protect American jobs.  (Applause.)  Thank you. Another historic trade blunder was the catastrophe known as NAFTA.  I have met the men and women of Michigan, Ohio, Pennsylvania, Indiana, New Hampshire, and many other states whose dreams were shattered by the signing of NAFTA.  For years, politicians promised them they would renegotiate for a better deal, but no one ever tried, until now. Our new U.S.-Mexico-Canada Agreement, the USMCA, will replace NAFTA and deliver for American workers like they haven’t had delivered to for a long time.  I hope you can pass the USMCA into law so that we can bring back our manufacturing jobs in even greater numbers, expand American agriculture, protect intellectual property, and ensure that more cars are proudly stamped with our four beautiful words: “Made in the USA.”  (Applause.) Tonight, I am also asking you to pass the United States Reciprocal Trade Act, so that if another country places an unfair tariff on an American product, we can charge them the exact same tariff on the exact same product that they sell to us.  (Applause.) Both parties should be able to unite for a great rebuilding of America’s crumbling infrastructure.  (Applause.) I know that Congress is eager to pass an infrastructure bill, and I am eager to work with you on legislation to deliver new and important infrastructure investment, including investments in the cutting-edge industries of the future.  This is not an option.  This is a necessity. The next major priority for me, and for all of us, should be to lower the cost of healthcare and prescription drugs, and to protect patients with preexisting conditions.  (Applause.) Already, as a result of my administration’s efforts, in 2018, drug prices experienced their single largest decline in 46 years.  (Applause.) But we must do more.  It’s unacceptable that Americans pay vastly more than people in other countries for the exact same drugs, often made in the exact same place.  This is wrong, this is unfair, and together we will stop it — and we’ll stop it fast.  (Applause.) I am asking Congress to pass legislation that finally takes on the problem of global freeloading and delivers fairness and price transparency for American patients, finally.  (Applause.) We should also require drug companies, insurance companies, and hospitals to disclose real prices to foster competition and bring costs way down.  (Applause.) No force in history has done more to advance the human condition than American freedom.  In recent years — (applause) — in recent years, we have made remarkable progress in the fight against HIV and AIDS.  Scientific breakthroughs have brought a once-distant dream within reach.  My budget will ask Democrats and Republicans to make the needed commitment to eliminate the HIV epidemic in the United States within 10 years.  We have made incredible strides.  Incredible.  (Applause.)  Together, we will defeat AIDS in America and beyond.  (Applause.) Tonight, I am also asking you to join me in another fight that all Americans can get behind: the fight against childhood cancer.  (Applause.) Joining Melania in the gallery this evening is a very brave 10-year-old girl, Grace Eline.  Every birthday — (applause) — hi, Grace.  (Laughter.)  Every birthday since she was four, Grace asked her friends to donate to St. Jude’s Children’s Hospital.  She did not know that one day she might be a patient herself.  That’s what happened. Last year, Grace was diagnosed with brain cancer. Immediately, she began radiation treatment.  At the same time, she rallied her community and raised more than $40,000 for the fight against cancer.  (Applause.)  When Grace completed treatment last fall, her doctors and nurses cheered — they loved her; they still love her — with tears in their eyes as she hung up a poster that read: “Last day of chemo.”  (Applause.)  Thank you very much, Grace.  You are a great inspiration to everyone in this room.  Thank you very much. Many childhood cancers have not seen new therapies in decades.  My budget will ask Congress for $500 million over the next 10 years to fund this critical lifesaving research. To help support working parents, the time has come to pass School Choice for Americans’ children.  (Applause.)  I am also proud to be the first President to include in my budget a plan for nationwide paid family leave, so that every new parent has the chance to bond with their newborn child.  (Applause.) There could be no greater contrast to the beautiful image of a mother holding her infant child than the chilling displays our nation saw in recent days.  Lawmakers in New York cheered with delight upon the passage of legislation that would allow a baby to be ripped from the mother’s womb moments from birth.  These are living, feeling, beautiful babies who will never get the chance to share their love and their dreams with the world.  And then, we had the case of the Governor of Virginia where he stated he would execute a baby after birth. To defend the dignity of every person, I am asking Congress to pass legislation to prohibit the late-term abortion of children who can feel pain in the mother’s womb.  (Applause.) Let us work together to build a culture that cherishes innocent life.  (Applause.)  And let us reaffirm a fundamental truth: All children — born and unborn — are made in the holy image of God. The final part of my agenda is to protect American security.  Over the last two years, we have begun to fully rebuild the United States military, with $700 billion last year and $716 billion this year. We are also getting other nations to pay their fair share.  (Applause.)  Finally.  Finally.  For years, the United States was being treated very unfairly by friends of ours, members of NATO.  But now we have secured, over the last couple of years, more than $100 billion of increase in defense spending from our NATO Allies.  (Applause.)  They said it couldn’t be done. As part of our military build-up, the United States is developing a state-of-the-art missile defense system. Under my administration, we will never apologize for advancing America’s interests. For example, decades ago, the United States entered into a treaty with Russia in which we agreed to limit and reduce our missile capability.  While we followed the agreement and the rules to the letter, Russia repeatedly violated its terms.  It’s been going on for many years.  That is why I announced that the United States is officially withdrawing from the Intermediate-Range Nuclear Forces Treaty, or INF Treaty. Perhaps — (applause) — we really have no choice.  Perhaps we can negotiate a different agreement, adding China and others, or perhaps we can’t — in which case, we will outspend and out-innovate all others by far.  (Applause.) As part of a bold new diplomacy, we continue our historic push for peace on the Korean Peninsula.  Our hostages have come home, nuclear testing has stopped, and there has not been a missile launch in more than 15 months.  If I had not been elected President of the United States, we would right now, in my opinion, be in a major war with North Korea.  (Applause.) Much work remains to be done, but my relationship with Kim Jong Un is a good one.  Chairman Kim and I will meet again on February 27th and 28th in Vietnam.  (Applause.) Two weeks ago, the United States officially recognized the legitimate government of Venezuela — (applause) — and its new President, Juan Guaidó.  (Applause.) We stand with the Venezuelan people in their noble quest for freedom, and we condemn the brutality of the Maduro regime, whose socialist policies have turned that nation from being the wealthiest in South America into a state of abject poverty and despair.  (Applause.) Here in the United States, we are alarmed by the new calls to adopt socialism in our country. AUDIENCE:  Booo — THE PRESIDENT:  America was founded on liberty and independence, and not government coercion, domination, and control.  (Applause.)  We are born free and we will stay free.  (Applause.) AUDIENCE:  USA!  USA!  USA! THE PRESIDENT:  Tonight, we renew our resolve that America will never be a socialist country.  (Applause.) AUDIENCE:  USA!  USA!  USA! THE PRESIDENT:  One of the most complex set of challenges we face, and have for many years, is in the Middle East.  Our approach is based on principled realism, not discredited theories that have failed for decades to yield progress.  For this reason, my administration recognized the true capital of Israel, and proudly opened the American Embassy in Jerusalem.  (Applause.) Our brave troops have now been fighting in the Middle East for almost 19 years.  In Afghanistan and Iraq, nearly 7,000 American heroes have given their lives.  More than 52,000 Americans have been badly wounded.  We have spent more than $7 trillion in fighting wars in the Middle East. As a candidate for President, I loudly pledged a new approach.  Great nations do not fight endless wars.  (Applause.) When I took office, ISIS controlled more than 20,000 square miles in Iraq and Syria — just two years ago.  Today, we have liberated virtually all of the territory from the grip of these bloodthirsty monsters. Now, as we work with our allies to destroy the remnants of ISIS, it is time to give our brave warriors in Syria a warm welcome home. I have also accelerated our negotiations to reach — if possible — a political settlement in Afghanistan.  The opposing side is also very happy to be negotiating.  Our troops have fought with unmatched valor.  And thanks to their bravery, we are now able to pursue a possible political solution to this long and bloody conflict.  (Applause.) In Afghanistan, my administration is holding constructive talks with a number of Afghan groups, including the Taliban.  As we make progress in these negotiations, we will be able to reduce our troop’s presence and focus on counterterrorism.  And we will indeed focus on counterterrorism. We do not know whether we will achieve an agreement, but we do know that, after two decades of war, the hour has come to at least try for peace.  And the other side would like to do the same thing.  It’s time.  (Applause.) Above all, friend and foe alike must never doubt this nation’s power and will to defend our people.  Eighteen years ago, violent terrorists attacked the USS Cole.  And last month, American forces killed one of the leaders of that attack. (Applause.) We are honored to be joined tonight by Tom Wibberley, whose son, Navy Seaman Craig Wibberley, was one of the 17 sailors we tragically lost.  Tom, we vow to always remember the heroes of the USS Cole.  (Applause.)  Thank you, Tom. My administration has acted decisively to confront the world’s leading state sponsor of terror: the radical regime in Iran.  It is a radical regime.  They do bad, bad things. To ensure this corrupt dictatorship never acquires nuclear weapons, I withdrew the United States from the disastrous Iran nuclear deal.  (Applause.) And last fall, we put in place the toughest sanctions ever imposed by us on a country. We will not avert our eyes from a regime that chants “Death to America” and threatens genocide against the Jewish people.  (Applause.)  We must never ignore the vile poison of anti-Semitism, or those who spread its venomous creed.  With one voice, we must confront this hatred anywhere and everywhere it occurs. Just months ago, 11 Jewish-Americans were viciously murdered in an anti-Semitic attack on the Tree of Life synagogue in Pittsburgh.  SWAT Officer Timothy Matson raced into the gunfire and was shot seven times chasing down the killer.  And he was very successful.  Timothy has just had his 12th surgery, and he is going in for many more.  But he made the trip to be here with us tonight.  Officer Matson, please.  (Applause.)  Thank you.  We are forever grateful.  Thank you very much. Tonight, we are also joined by Pittsburgh survivor, Judah Samet.  He arrived at the synagogue as the massacre began.  But not only did Judah narrowly escape death last fall, more than seven decades ago, he narrowly survived the Nazi concentration camps.  Today is Judah’s 81st birthday.  (Applause.) AUDIENCE:  (Sings “Happy Birthday.”)  (Applause.) MR. SAMET:  Thank you! THE PRESIDENT:  They wouldn’t do that for me, Judah.  (Laughter.) Judah says he can still remember the exact moment, nearly 75 years ago, after 10 months in a concentration camp, when he and his family were put on a train and told they were going to another camp.  Suddenly, the train screeched to a very strong halt.  A soldier appeared.  Judah’s family braced for the absolute worst.  Then, his father cried out with joy, “It’s the Americans!  It’s the Americans!”  (Applause.)  Thank you. A second Holocaust survivor who is here tonight, Joshua Kaufman, was a prisoner at Dachau.  He remembers watching through a hole in the wall of a cattle car as American soldiers rolled in with tanks.  “To me,” Joshua recalls, “the American soldiers were proof that God exists, and they came down from the sky.”  They came down from Heaven. I began this evening by honoring three soldiers who fought on D-Day in the Second World War.  One of them was Herman Zeitchik.  But there is more to Herman’s story.  A year after he stormed the beaches of Normandy, Herman was one of the American soldiers who helped liberate Dachau.  (Applause.)  He was one of the Americans who helped rescue Joshua from that hell on Earth. Almost 75 years later, Herman and Joshua are both together in the gallery tonight, seated side-by-side, here in the home of American freedom.  Herman and Joshua, your presence this evening is very much appreciated.  Thank you very much.  (Applause.)  Thank you. When American soldiers set out beneath the dark skies over the English Channel in the early hours of D-Day, 1944, they were just young men of 18 and 19, hurtling on fragile landing craft toward the most momentous battle in the history of war. They did not know if they would survive the hour.  They did not know if they would grow old.  But they knew that America had to prevail.  Their cause was this nation and generations yet unborn. Why did they do it?  They did it for America.  They did it for us. Everything that has come since — our triumph over communism, our giant leaps of science and discovery, our unrivaled progress towards equality and justice — all of it is possible thanks to the blood and tears and courage and vision of the Americans who came before. Think of this Capitol.  Think of this very Chamber, where lawmakers before you voted to end slavery, to build the railroads and the highways, and defeat fascism, to secure civil rights, and to face down evil empires. Here tonight, we have legislators from across this magnificent republic.  You have come from the rocky shores of Maine and the volcanic peaks of Hawaii; from the snowy woods of Wisconsin and the red deserts of Arizona; from the green farms of Kentucky and the golden beaches of California.  Together, we represent the most extraordinary nation in all of history. What will we do with this moment?  How will we be remembered? I ask the men and women of this Congress: Look at the opportunities before us.  Our most thrilling achievements are still ahead.  Our most exciting journeys still await.  Our biggest victories are still to come.  We have not yet begun to dream. We must choose whether we are defined by our differences or whether we dare to transcend them. We must choose whether we squander our great inheritance or whether we proudly declare that we are Americans. We do the incredible.  We defy the impossible.  We conquer the unknown. This is the time to reignite the American imagination.  This is the time to search for the tallest summit and set our sights on the brightest star.  This is the time to rekindle the bonds of love and loyalty and memory that link us together as citizens, as neighbors, as patriots. This is our future, our fate, and our choice to make.  I am asking you to choose greatness. No matter the trials we face, no matter the challenges to come, we must go forward together. We must keep America first in our hearts.  We must keep freedom alive in our souls.  And we must always keep faith in America’s destiny that one nation, under God, must be the hope and the promise, and the light and the glory, among all the nations of the world. Thank you.  God bless you.  And God bless America.  Thank you very much.  Thank you.  (Applause.) END                  10:29 P.M. EST\n",
      "=====================\n"
     ]
    }
   ],
   "source": [
    "def get_only_text(url):\n",
    "    \"\"\" \n",
    "    return the title and the text of the article\n",
    "    at the specified url\n",
    "    \"\"\"\n",
    "    page = urlopen(url)\n",
    "    soup = BeautifulSoup(page, \"lxml\")\n",
    "    text = ' '.join(map(lambda p: p.text, soup.find_all('p')))\n",
    "  \n",
    "    print (\"=====================\")\n",
    "    print (text)\n",
    "    print (\"=====================\")\n",
    " \n",
    "    return soup.title.text, text    \n",
    " \n",
    "     \n",
    "url=\"https://www.whitehouse.gov/briefings-statements/remarks-president-trump-state-union-address-2/\"\n",
    "text = get_only_text(url)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['An amazing quality of life for all of our citizens is within reach.',\n",
       " 'We can make our communities safer, our families stronger, our culture richer, our faith deeper, and our middle class bigger and more prosperous than ever before.',\n",
       " '(Applause.)',\n",
       " 'But we must reject the politics of revenge, resistance, and retribution, and embrace the boundless potential of cooperation, compromise, and the common good.',\n",
       " '(Applause.)',\n",
       " 'Together, we can break decades of political stalemate.',\n",
       " 'We can bridge old divisions, heal old wounds, build new coalitions, forge new solutions, and unlock the extraordinary promise of America’s future.',\n",
       " 'The decision is ours to make.',\n",
       " 'We must choose between greatness or gridlock, results or resistance, vision or vengeance, incredible progress or pointless destruction.',\n",
       " 'Tonight, I ask you to choose greatness.']"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sentences = []\n",
    "for s in text:\n",
    "    sentences.append(sent_tokenize(s))\n",
    "\n",
    "sentences = [y for x in sentences for y in x]\n",
    "sentences[30:40]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Extract word vectors\n",
    "word_embeddings = {}\n",
    "f = open('glove.6B.100d.txt', encoding='utf-8')\n",
    "for line in f:\n",
    "    values = line.split()\n",
    "    word = values[0]\n",
    "    coefs = np.asarray(values[1:], dtype='float32')\n",
    "    word_embeddings[word] = coefs\n",
    "f.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "400000"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(word_embeddings)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Text cleanining"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "# remove punctuations, numbers and special characters\n",
    "clean_sentences = pd.Series(sentences).str.replace(\"[^a-zA-Z]\", \" \")\n",
    "\n",
    "# change to lowercase\n",
    "clean_sentences = [s.lower() for s in clean_sentences]\n",
    "stop_words = stopwords.words('english')\n",
    "# function to remove stopwords\n",
    "def remove_stopwords(sen):\n",
    "    sen_new = \" \".join([i for i in sen if i not in stop_words])\n",
    "    return sen_new\n",
    "clean_sentences = [remove_stopwords(r.split()) for r in clean_sentences]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "sentence_vectors = []\n",
    "for i in clean_sentences:\n",
    "    if len(i) != 0:\n",
    "        v = sum([word_embeddings.get(w, np.zeros((100,))) for w in i.split()])/(len(i.split())+0.001)\n",
    "    else:\n",
    "        v = np.zeros((100,))\n",
    "    sentence_vectors.append(v)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Create an empty similarity matrix\n",
    "sim_mat = np.zeros([len(sentences), len(sentences)])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "for i in range(len(sentences)):\n",
    "    for j in range(len(sentences)):\n",
    "        if i != j:\n",
    "            sim_mat[i][j] = cosine_similarity(sentence_vectors[i].reshape(1,100), sentence_vectors[j].reshape(1,100))[0,0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "After 24 months of rapid progress, our economy is the envy of the world, our military is the most powerful on Earth, by far, and America — (applause) — America is again winning each and every day.\n",
      "Millions of our fellow citizens are watching us now, gathered in this great chamber, hoping that we will govern not as two parties but as one nation.\n",
      "I hope you can pass the USMCA into law so that we can bring back our manufacturing jobs in even greater numbers, expand American agriculture, protect intellectual property, and ensure that more cars are proudly stamped with our four beautiful words: “Made in the USA.”  (Applause.)\n",
      "When Grace completed treatment last fall, her doctors and nurses cheered — they loved her; they still love her — with tears in their eyes as she hung up a poster that read: “Last day of chemo.”  (Applause.)\n",
      "We do not know whether we will achieve an agreement, but we do know that, after two decades of war, the hour has come to at least try for peace.\n",
      "Perhaps — (applause) — we really have no choice.\n",
      "And we must always keep faith in America’s destiny that one nation, under God, must be the hope and the promise, and the light and the glory, among all the nations of the world.\n",
      "Tonight, I am also asking you to join me in another fight that all Americans can get behind: the fight against childhood cancer.\n",
      "Lawmakers in New York cheered with delight upon the passage of legislation that would allow a baby to be ripped from the mother’s womb moments from birth.\n",
      "Judah says he can still remember the exact moment, nearly 75 years ago, after 10 months in a concentration camp, when he and his family were put on a train and told they were going to another camp.\n"
     ]
    }
   ],
   "source": [
    "nx_graph = nx.from_numpy_array(sim_mat)\n",
    "scores = nx.pagerank(nx_graph)\n",
    "ranked_sentences = sorted(((scores[i],s) for i,s in enumerate(sentences)), reverse=True)\n",
    "# Extract top 15 sentences as the summary representation\n",
    "for i in range(10):\n",
    "    print(ranked_sentences[i][1])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Gensim"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "import logging\n",
    "logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)\n",
    "from gensim.summarization import summarize\n",
    "from gensim.summarization import keywords\n",
    "import urllib.request\n",
    "from urllib.request import urlopen\n",
    "from bs4 import BeautifulSoup\n",
    "import requests"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2019-02-07 00:05:05,197 : INFO : adding document #0 to Dictionary(0 unique tokens: [])\n",
      "2019-02-07 00:05:05,197 : INFO : built Dictionary(1371 unique tokens: ['bno', 'classnam', 'document', 'documentel', 'replac']...) from 539 documents (total 3371 corpus positions)\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Summary:\n",
      "<meta property=\"og:description\" content=\"February 5, 2019 9:07 P.M. EST THE PRESIDENT:  Madam Speaker, Mr. Vice President, Members of Congress, the First Lady of the United States &#8212; (applause) &#8212; and my fellow Americans: We meet tonight at a moment of unlimited potential.\n",
      "<meta name=\"twitter:description\" content=\"February 5, 2019 9:07 P.M. EST THE PRESIDENT:  Madam Speaker, Mr. Vice President, Members of Congress, the First Lady of the United States &#8212; (applause) &#8212; and my fellow Americans: We meet tonight at a moment of unlimited potential.\n",
      "<script type='application/ld+json'>{\"@context\":\"http:\\/\\/schema.org\",\"@type\":\"Organization\",\"url\":\"https:\\/\\/www.whitehouse.gov\\/briefings-statements\\/remarks-president-trump-state-union-address-2\\/\",\"sameAs\":[\"https:\\/\\/facebook.com\\/whitehouse\",\"https:\\/\\/instagram.com\\/whitehouse\",\"https:\\/\\/www.youtube.com\\/user\\/whitehouse\",\"https:\\/\\/twitter.com\\/whitehouse\"],\"@id\":\"#organization\",\"name\":\"The White House\",\"logo\":\"https:\\/\\/www.whitehouse.gov\\/wp-content\\/uploads\\/2017\\/12\\/wh.gov-share-img_03.png\"}</script>\n",
      "<p>THE PRESIDENT:  Madam Speaker, Mr. Vice President, Members of Congress, the First Lady of the United States &#8212; (applause) &#8212; and my fellow Americans:</p>\n",
      "<p>Many of us have campaigned on the same core promises: to defend American jobs and demand fair trade for American workers; to rebuild and revitalize our nation’s infrastructure; to reduce the price of healthcare and prescription drugs; to create an immigration system that is safe, lawful, modern, and secure; and to pursue a foreign policy that puts America’s interests first.</p>\n",
      "\n",
      "Keywords:\n",
      "class\n",
      "americans\n",
      "american\n",
      "new\n",
      "news\n",
      "function\n",
      "menu\n"
     ]
    }
   ],
   "source": [
    "text = requests.get('https://www.whitehouse.gov/briefings-statements/remarks-president-trump-state-union-address-2/').text\n",
    "\n",
    "print('Summary:')\n",
    "print(summarize(text, ratio=0.01))\n",
    "\n",
    "print('\\nKeywords:')\n",
    "print(keywords(text, ratio=0.01))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Sumy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from __future__ import absolute_import\n",
    "from __future__ import division, print_function, unicode_literals\n",
    " \n",
    "from sumy.parsers.html import HtmlParser\n",
    "from sumy.parsers.plaintext import PlaintextParser\n",
    "from sumy.nlp.tokenizers import Tokenizer\n",
    "from sumy.summarizers.lsa import LsaSummarizer\n",
    "from sumy.nlp.stemmers import Stemmer\n",
    "from sumy.utils import get_stop_words\n",
    " \n",
    "from sumy.summarizers.luhn import LuhnSummarizer\n",
    "from sumy.summarizers.edmundson import EdmundsonSummarizer\n",
    "from sumy.summarizers.lex_rank import LexRankSummarizer"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "LANGUAGE = \"english\"\n",
    "SENTENCES_COUNT = 10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "--LsaSummarizer--\n",
      "Now is the time for Congress to show the world that America is committed to ending illegal immigration and putting the ruthless coyotes, cartels, drug dealers, and human traffickers out of business.\n",
      "Meanwhile, working-class Americans are left to pay the price for mass illegal migration: reduced jobs, lower wages, overburdened schools, hospitals that are so crowded you can’t get in, increased crime, and a depleted social safety net.\n",
      "Tens of thousands of innocent Americans are killed by lethal drugs that cross our border and flood into our cities, including meth, heroin, cocaine, and fentanyl.\n",
      "In the last two years, our brave ICE officers made 266,000 arrests of criminal aliens, including those charged or convicted of nearly 100,000 assaults, 30,000 sex crimes, and 4,000 killings or murders.\n",
      "I hope you can pass the USMCA into law so that we can bring back our manufacturing jobs in even greater numbers, expand American agriculture, protect intellectual property, and ensure that more cars are proudly stamped with our four beautiful words: “Made in the USA.” (Applause.)\n",
      "We stand with the Venezuelan people in their noble quest for freedom, and we condemn the brutality of the Maduro regime, whose socialist policies have turned that nation from being the wealthiest in South America into a state of abject poverty and despair.\n",
      "When American soldiers set out beneath the dark skies over the English Channel in the early hours of D-Day, 1944, they were just young men of 18 and 19, hurtling on fragile landing craft toward the most momentous battle in the history of war.\n",
      "Everything that has come since — our triumph over communism, our giant leaps of science and discovery, our unrivaled progress towards equality and justice — all of it is possible thanks to the blood and tears and courage and vision of the Americans who came before.\n",
      "Think of this very Chamber, where lawmakers before you voted to end slavery, to build the railroads and the highways, and defeat fascism, to secure civil rights, and to face down evil empires.\n",
      "You have come from the rocky shores of Maine and the volcanic peaks of Hawaii; from the snowy woods of Wisconsin and the red deserts of Arizona; from the green farms of Kentucky and the golden beaches of California.\n"
     ]
    }
   ],
   "source": [
    "url=\"https://www.whitehouse.gov/briefings-statements/remarks-president-trump-state-union-address-2/\"\n",
    "parser = HtmlParser.from_url(url, Tokenizer(LANGUAGE))\n",
    "print (\"--LsaSummarizer--\")    \n",
    "summarizer = LsaSummarizer()\n",
    "summarizer = LsaSummarizer(Stemmer(LANGUAGE))\n",
    "summarizer.stop_words = get_stop_words(LANGUAGE)\n",
    "for sentence in summarizer(parser.document, SENTENCES_COUNT):\n",
    "    print(sentence)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "--LuhnSummarizer--\n",
      "Many of us have campaigned on the same core promises: to defend American jobs and demand fair trade for American workers; to rebuild and revitalize our nation’s infrastructure; to reduce the price of healthcare and prescription drugs; to create an immigration system that is safe, lawful, modern, and secure; and to pursue a foreign policy that puts America’s interests first.\n",
      "Human traffickers and sex traffickers take advantage of the wide-open areas between our ports of entry to smuggle thousands of young girls and women into the United States and to sell them into prostitution and modern-day slavery.\n",
      "Elvin says that, “If I can make sure these young girls get their justice, I’ve [really] done my job.” Thanks to his work, and that of his incredible colleagues, more than 300 women and girls have been rescued from the horror of this terrible situation, and more than 1,500 sadistic traffickers have been put behind bars.\n",
      "The border city of El Paso, Texas used to have extremely high rates of violent crime — one of the highest in the entire country, and considered one of our nation’s most dangerous cities.\n",
      "I hope you can pass the USMCA into law so that we can bring back our manufacturing jobs in even greater numbers, expand American agriculture, protect intellectual property, and ensure that more cars are proudly stamped with our four beautiful words: “Made in the USA.” (Applause.)\n",
      "Tonight, I am also asking you to pass the United States Reciprocal Trade Act, so that if another country places an unfair tariff on an American product, we can charge them the exact same tariff on the exact same product that they sell to us.\n",
      "When Grace completed treatment last fall, her doctors and nurses cheered — they loved her; they still love her — with tears in their eyes as she hung up a poster that read: “Last day of chemo.” (Applause.)\n",
      "Perhaps we can negotiate a different agreement, adding China and others, or perhaps we can’t — in which case, we will outspend and out-innovate all others by far.\n",
      "We do not know whether we will achieve an agreement, but we do know that, after two decades of war, the hour has come to at least try for peace.\n",
      "Judah says he can still remember the exact moment, nearly 75 years ago, after 10 months in a concentration camp, when he and his family were put on a train and told they were going to another camp.\n"
     ]
    }
   ],
   "source": [
    "print (\"--LuhnSummarizer--\")     \n",
    "summarizer = LuhnSummarizer() \n",
    "summarizer = LuhnSummarizer(Stemmer(LANGUAGE))\n",
    "summarizer.stop_words = (\"I\", \"am\", \"the\", \"you\", \"are\", \"me\", \"is\", \"than\", \"that\", \"this\")\n",
    "for sentence in summarizer(parser.document, SENTENCES_COUNT):\n",
    "    print(sentence)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "--EdmundsonSummarizer--\n",
      "February 5, 2019\n",
      "9:07 P.M. EST\n",
      "We meet tonight at a moment of unlimited potential.\n",
      "As we begin a new Congress, I stand here ready to work with you to achieve historic breakthroughs for all Americans.\n",
      "Millions of our fellow citizens are watching us now, gathered in this great chamber, hoping that we will govern not as two parties but as one nation.\n",
      "(Applause.)\n",
      "The agenda I will lay out this evening is not a Republican agenda or a Democrat agenda.\n",
      "It’s the agenda of the American people.\n",
      "There is a new opportunity in American politics, if only we have the courage, together, to seize it.\n",
      "Tonight, I am also asking you to join me in another fight that all Americans can get behind: the fight against childhood cancer.\n",
      "END 10:29 P.M. EST\n"
     ]
    }
   ],
   "source": [
    "print (\"--EdmundsonSummarizer--\")     \n",
    "summarizer = EdmundsonSummarizer() \n",
    "words1 = (\"economy\", \"fight\", \"trade\", \"china\")\n",
    "summarizer.bonus_words = words1\n",
    "     \n",
    "words2 = (\"another\", \"and\", \"some\", \"next\")\n",
    "summarizer.stigma_words = words2\n",
    "    \n",
    "words3 = (\"another\", \"and\", \"some\", \"next\")\n",
    "summarizer.null_words = words3\n",
    "for sentence in summarizer(parser.document, SENTENCES_COUNT):\n",
    "    print(sentence)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "--LexRankSummarizer--\n",
      "Many of us have campaigned on the same core promises: to defend American jobs and demand fair trade for American workers; to rebuild and revitalize our nation’s infrastructure; to reduce the price of healthcare and prescription drugs; to create an immigration system that is safe, lawful, modern, and secure; and to pursue a foreign policy that puts America’s interests first.\n",
      "Tonight, I am asking you to defend our very dangerous southern border out of love and devotion to our fellow citizens and to our country.\n",
      "And thank you for being here.\n",
      "When Elvin — (applause) — thank you.\n",
      "To build on — (applause) — thank you.\n",
      "I have great respect for President Xi, and we are now working on a new trade deal with China.\n",
      "But we must do more.\n",
      "As we make progress in these negotiations, we will be able to reduce our troop’s presence and focus on counterterrorism.\n",
      "It’s time.\n",
      "It’s the Americans!” (Applause.)\n"
     ]
    }
   ],
   "source": [
    "print (\"--LexRankSummarizer--\")   \n",
    "summarizer = LexRankSummarizer()\n",
    "summarizer = LexRankSummarizer(Stemmer(LANGUAGE))\n",
    "summarizer.stop_words = (\"I\", \"am\", \"the\", \"you\", \"are\", \"me\", \"is\", \"than\", \"that\", \"this\")\n",
    "for sentence in summarizer(parser.document, SENTENCES_COUNT):\n",
    "    print(sentence)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
